home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume7 / xtiff / patch3 < prev    next >
Encoding:
Internet Message Format  |  1990-06-18  |  6.2 KB

  1. Path: uunet!lll-winken!sun-barr!newstop!sun!decpa.pa.dec.com
  2. From: dbs@decpa.pa.dec.com (dan sears)
  3. Newsgroups: comp.sources.x
  4. Subject: v07i100: xtiff, Patch3, Part01/01
  5. Message-ID: <137466@sun.Eng.Sun.COM>
  6. Date: 18 Jun 90 19:56:03 GMT
  7. Sender: news@sun.Eng.Sun.COM
  8. Lines: 151
  9. Approved: argv@sun.com
  10.  
  11. Submitted-by: dbs@decpa.pa.dec.com (dan sears)
  12. Posting-number: Volume 7, Issue 100
  13. Archive-name: xtiff/patch3
  14. Patch-To: xtiff: Volume 7, Issue 36 (5/12/90)
  15. Patch-To: xtiff: Volume 7, Issue 54 (5/17/90) patch1
  16. Patch-To: xtiff: Volume 7, Issue 80 (5/31/90) patch2
  17.  
  18. This patch fixes a bug in handling different color masks and byte orders
  19. for DirectColor visuals.
  20.  
  21. --Dan Sears
  22.  
  23. diff -r -c rev2/patchlevel.h rev3/patchlevel.h
  24. *** rev2/patchlevel.h    Tue May 29 19:02:02 1990
  25. --- rev3/patchlevel.h    Mon Jun 18 11:01:30 1990
  26. ***************
  27. *** 1 ****
  28. ! #define PATCHLEVEL 2
  29. --- 1 ----
  30. ! #define PATCHLEVEL 3
  31. diff -r -c rev2/xtiff.c rev3/xtiff.c
  32. *** rev2/xtiff.c    Tue May 29 19:02:03 1990
  33. --- rev3/xtiff.c    Mon Jun 18 11:19:11 1990
  34. ***************
  35. *** 4,11 ****
  36.    * Dan Sears
  37.    * Chris Sears
  38.    *
  39.    * Revsion 1.2  90/05/29
  40. !  *      Fixed a bug with MINISWHTE images.
  41.    * Revsion 1.1  90/05/16
  42.    *      Fixed a few minor bugs.
  43.    * Revsion 1.0  90/05/07
  44. --- 4,14 ----
  45.    * Dan Sears
  46.    * Chris Sears
  47.    *
  48. +  * Revsion 1.3  90/06/18
  49. +  *      Fixed a bug in handling different color masks and byte orders
  50. +  *          for DirectColor visuals.
  51.    * Revsion 1.2  90/05/29
  52. !  *      Fixed a bug with MINISWHITE images.
  53.    * Revsion 1.1  90/05/16
  54.    *      Fixed a few minor bugs.
  55.    * Revsion 1.0  90/05/07
  56. ***************
  57. *** 559,570 ****
  58.           /*
  59.            * Handle different color masks for different frame buffers.
  60.            */
  61. !         red_shift = pixel_map[0] = xRedMask == 0xFF000000 ? 3
  62. !             : (xRedMask == 0xFF0000 ? 2 : (xRedMask == 0xFF00 ? 1 : 0));
  63. !         green_shift = pixel_map[1] = xGreenMask == 0xFF000000 ? 3
  64. !             : (xGreenMask == 0xFF0000 ? 2 : (xGreenMask == 0xFF00 ? 1 : 0));
  65. !         blue_shift = pixel_map[2] = xBlueMask == 0xFF000000 ? 3
  66. !             : (xBlueMask == 0xFF0000 ? 2 : (xBlueMask == 0xFF00 ? 1 : 0));
  67.   
  68.           if (tfPlanarConfiguration == PLANARCONFIG_CONTIG) {
  69.               for (i = 0; i < tfImageHeight; i++) {
  70. --- 562,582 ----
  71.           /*
  72.            * Handle different color masks for different frame buffers.
  73.            */
  74. !         if (ImageByteOrder(xDisplay) == LSBFirst) { /* DECstation 5000 */
  75. !             red_shift = pixel_map[0] = xRedMask == 0xFF000000 ? 3
  76. !                 : (xRedMask == 0xFF0000 ? 2 : (xRedMask == 0xFF00 ? 1 : 0));
  77. !             green_shift = pixel_map[1] = xGreenMask == 0xFF000000 ? 3
  78. !                 : (xGreenMask == 0xFF0000 ? 2 : (xGreenMask == 0xFF00 ? 1 : 0));
  79. !             blue_shift = pixel_map[2] = xBlueMask == 0xFF000000 ? 3
  80. !                 : (xBlueMask == 0xFF0000 ? 2 : (xBlueMask == 0xFF00 ? 1 : 0));
  81. !         } else { /* Ardent */
  82. !             red_shift = pixel_map[0] = xRedMask == 0xFF000000 ? 0
  83. !                 : (xRedMask == 0xFF0000 ? 1 : (xRedMask == 0xFF00 ? 2 : 3));
  84. !             green_shift = pixel_map[0] = xGreenMask == 0xFF000000 ? 0
  85. !                 : (xGreenMask == 0xFF0000 ? 1 : (xGreenMask == 0xFF00 ? 2 : 3));
  86. !             blue_shift = pixel_map[0] = xBlueMask == 0xFF000000 ? 0
  87. !                 : (xBlueMask == 0xFF0000 ? 1 : (xBlueMask == 0xFF00 ? 2 : 3));
  88. !         }
  89.   
  90.           if (tfPlanarConfiguration == PLANARCONFIG_CONTIG) {
  91.               for (i = 0; i < tfImageHeight; i++) {
  92. ***************
  93. *** 719,748 ****
  94.   void
  95.   EventLoop()
  96.   {
  97. !     XEvent event;
  98.   
  99.       for (;;) {
  100.           XNextEvent(xDisplay, &event);
  101.   
  102.           switch (event.type) {
  103. !         case Expose:
  104. !             if (xPixmapFlag == True) {
  105. !                 if (xImageDepth == 1)
  106. !                     XCopyPlane(xDisplay, xImagePixmap, xWindow, xWinGc,
  107.                           event.xexpose.x, event.xexpose.y,
  108. -                         event.xexpose.width, event.xexpose.height,
  109. -                         event.xexpose.x, event.xexpose.y, 1);
  110. -                 else
  111. -                     XCopyArea(xDisplay, xImagePixmap, xWindow, xWinGc,
  112.                           event.xexpose.x, event.xexpose.y,
  113. !                         event.xexpose.width, event.xexpose.height,
  114. !                         event.xexpose.x, event.xexpose.y);
  115. !             } else
  116. !                 XPutImage(xDisplay, xWindow, xWinGc, xImage,
  117. !                     event.xexpose.x, event.xexpose.y,
  118. !                     event.xexpose.x, event.xexpose.y,
  119. !                     event.xexpose.width, event.xexpose.height);
  120. !             break;
  121.           case ButtonPress:
  122.               if (xPixmapFlag == False)
  123.                   free(imageMemory);
  124. --- 731,762 ----
  125.   void
  126.   EventLoop()
  127.   {
  128. !     XEvent event, button;
  129.   
  130.       for (;;) {
  131.           XNextEvent(xDisplay, &event);
  132.   
  133.           switch (event.type) {
  134. !         case Expose:    /* Let an application quit as fast as possible */
  135. !             if (!XCheckTypedEvent(xDisplay, ButtonPress, &button)) {
  136. !                 if (xPixmapFlag == True) {
  137. !                     if (xImageDepth == 1)
  138. !                         XCopyPlane(xDisplay, xImagePixmap, xWindow, xWinGc,
  139. !                             event.xexpose.x, event.xexpose.y,
  140. !                             event.xexpose.width, event.xexpose.height,
  141. !                             event.xexpose.x, event.xexpose.y, 1);
  142. !                     else
  143. !                         XCopyArea(xDisplay, xImagePixmap, xWindow, xWinGc,
  144. !                             event.xexpose.x, event.xexpose.y,
  145. !                             event.xexpose.width, event.xexpose.height,
  146. !                             event.xexpose.x, event.xexpose.y);
  147. !                 } else
  148. !                     XPutImage(xDisplay, xWindow, xWinGc, xImage,
  149.                           event.xexpose.x, event.xexpose.y,
  150.                           event.xexpose.x, event.xexpose.y,
  151. !                         event.xexpose.width, event.xexpose.height);
  152. !                 break;
  153. !             }
  154.           case ButtonPress:
  155.               if (xPixmapFlag == False)
  156.                   free(imageMemory);
  157.  
  158. dan
  159. ----------------------------------------------------
  160. O'Reilly && Associates   argv@sun.com / argv@ora.com
  161. Opinions expressed reflect those of the author only.
  162.